package com.punch.course.exception;

import com.punch.common.exception.ExceptionEnum;

/**
 * 系统模块自定义异常枚举
 *
 * @author cyd
 * @since 2019-12-05
 */
public enum CourseExceptionEnum implements ExceptionEnum {

    COURSE_DEL_SUCCESS(1001, "课程删除成功!"),

    COURSE_DEL_FAIL(1002, "课程删除失败!"),

    COURSE_DEL_FAIL_NULL(1003, "课程删除失败，没有对应的记录"),

    COURSE_SAVE_FAIL(1004, "课程新增失败"),

    COURSE_EDIT_FAIL(1005, "课程修改失败"),

    CLASSROOM_SAVE_FAIL(1006, "教室保存失败"),

    CLASSROOM_EDIT_FAIL(1007, "教室编辑失败"),

    CLASSROOM_DEL_FAIL(1008, "教室删除失败"),

    CLASSROOM_DEL_SUCCESS(1009, "教室删除成功"),

    CLASSROOM_DEL_FAIL_NULL(1010, "教室删除失败，没有对应的记录"),

    CLASSROOM_DETAIL_FAIL_NULL(1010, "未查询到教室信息"),

    CLASS_DETAIL_FAIL_NULL(1011, "未查询到班级信息"),

    CLASS_SAVE_FAIL(1012, "班级保存失败"),

    CLASS_EDIT_FAIL(1013, "班级编辑失败"),

    CLASS_DEL_FAIL_NULL(1014, "班级删除失败，没有对应的记录"),

    CLASS_DEL_FAIL(1015, "班级删除失败"),

    CLASS_DEL_SUCCESS(1016, "班级删除成功"),

    CLASSROOM_EDIT_SUCCESS(10017, "教室编辑成功"),

    CLASS_SAVE_SUCCESS(1018, "班级保存成功"),

    CLASS_EDIT_SUCCESS(10019, "班级编辑成功"),

    COURSE_SAVE_SUCCESS(1020, "课程保存成功!"),

    COURSE_EDIT_SUCCESS(1020, "课程修改成功!"),

    CLASS_EXAMINE_SUCCESS(1021, "审核操作成功!"),

    CLASS_EXAMINE_FAIL_NULL(1022, "无班级信息"),

    CLASS_EXAMINE_ILLEGAL(1022, "待审核为默认状态，操作失败"),

    CLASS_EXAMINE_ILLEGALA(1023, "当前状态不是待审核，操作失败"),

    CLASS_EXAMINE_ILLEGALA_FIAL(1024, "非法状态，操作失败"),

    CLASS_STATE_NOT_EXAMINE(1025, "当前状态不是审核中，操作失败"),

    CLASS_STATE_NOT_EXAMINEING(1026, "当前状态不是审核成功，操作失败"),

    CLASS_STATE_NOT_REGISTING(1027, "当前状态不是报名中，操作失败"),

    CLASS_STATE_NOT_REGISTSUCCESS(1028, "当前状态不是报名成功，操作失败"),

    COURSE_DETAIL_FAIL_NULL(1029, "未查询到课程信息"),

    COURSE_UPDATE_STATUS_ERROR(1030, "只有待审核/审核失败才能修改课程"),

    COURSE_DELETE_STATUS_ERROR(1031, "只有待审核/审核失败情况下才能删除课程"),

    CLASS_ROOM_NOT_EXIST(1032, "教室不存在"),

    AUDIT_ERROR(1033, "审核状态错误"),

    COURSE_TO_TEACHING_EXIST(1034, "课程已申请授课该学校"),

    COURSE_NOT_TO_SCHOOL(1035, "课程暂未授课该学校"),

    ONLY_SCHOOL_CAN_AGREE_TEACH(1036, "只有学校才能同意授课"),

    ONLY_SCHOOL_CAN_REMOVE_LIBRARY(1037, "只有学校移除课程库"),

    REMOVE_LIBRARY_ERROR(1038, "移除课程库错误"),

    COURSE_LIBRARY_NOT_EXIST(1039, "课程库不存在"),

    COURSE_STATUS_ERROR(1040, "课程状态错误"),

    SCHOOL_DEL_FAIL(1041, "学校删除失败!"),

    SCHOOL_DEL_SUCESS(1042, "学校删除成功!"),

    SCHOOL_IS_NULL(1043, "学校信息不存在!"),

    COURSE_TEACHING_NOT_EXIST(1044, "授课申请不存在"),

    COURSE_TEACHING_STATUS_ERROR(1045, "授课申请状态错误"),

    CLASS_OPEN_DATE_LESS_THEN_REGIST_END_TIME(1046, "开班时间要大于报名截止时间"),

    ONLY_ADMIN_OR_MANAGE_CAN_DO(1047, "只有管理员/运营人员才能进行操作"),

    CLASS_SIGN_UP_NOT_TO_MIN_NUMBER(1048, "班级未达到开班最小人数"),

    CLASS_NEED_MATERIAL_SUPPLIER(1049, "该课程需要教材/教具未设置供应商，请联系运营人员"),

    SIGN_IN_EXCEED_TIME(1050, "超过点名时间"),

    ONLY_ORG_APPLY_SCHOOL(1051, "只有机构才能申请开班"),

    CLASS_STATUS_ERROR(1052, "班级状态错误"),

    REGISTENDTIME_LESS_THEN_REGISTSTARTTIME(1053, "报名开始时间大于截止时间"),

    ONLY_SCHOOL_RELEASE(1054, "只有学校才能进行发布班级"),

    ONLY_SCHOOL_CANCEL_SIGN_UP(1055, "只有学校才能取消报名"),

    GOODS_NOT_EXIST(1056, "商品不存在"),

    SIGN_UP_EXCEED_MAX(1057, "报名人数已满"),
    ;

    private int code;
    private String msg;

    /**
     * 构造方法
     *
     * @param code    异常编码
     * @param message 异常信息
     * @author cyd
     * @since 2019-12-05
     */
    CourseExceptionEnum(int code, String message) {
        this.code = code;
        this.msg = message;
    }

    /**
     * 获取异常编码
     */
    @Override
    public Integer getCode() {
        return code;
    }

    /**
     * 获取异常信息
     */
    @Override
    public String getMsg() {
        return msg;
    }

}
